package com.zsc.edu.gateway.modules.iot.record.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
//import com.zsc.edu.gateway.framework.json.MapJsonTypeHandler;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.zsc.edu.gateway.framework.json.JsonbTypeHandler;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @author zhuang
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@TableName("iot_record_data")
public class RecordData {
    @TableId
    private String id;

    private String clientId;

    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> content;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime recordTime;

    @TableField(value = "dept_id", fill = FieldFill.INSERT)
    public Long deptId;

    @TableField(value = "create_id", fill = FieldFill.INSERT)
    public Long createId;

}
